Added some clarifying comments regarding xenbus/xenstore kernel startup.
authorsmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Sun, 9 Oct 2005 19:55:53 +0000 (20:55 +0100)
committersmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Sun, 9 Oct 2005 19:55:53 +0000 (20:55 +0100)
Signed-off-by: Steven Hand <steven@xensource.com>
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c

index f3103092f181fc9bc57b464ddc9cdc18435e8d4d..6ed338bab10e48d3da2f35768733b313039cd9cd 100644 (file)
@@ -246,7 +246,10 @@ static int privcmd_ioctl(struct inode *inode, struct file *file,
                                   PAGE_SHIFT);
                ret = xen_start_info->store_mfn;
 
-               /* We'll return then this will wait for daemon to answer */
+               /* 
+               ** Complete initialization of xenbus (viz. set up the 
+               ** connection to xenstored now that it has started). 
+               */
                kthread_run(do_xenbus_probe, NULL, "xenbus_probe");
        }
        break;
index a320bf36ae7d488d96f3d9991ec68cd1e13e06ed..5db856fe44b164076b25a792dc5a92236cdd7ea3 100644 (file)
@@ -666,12 +666,16 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
 }
 EXPORT_SYMBOL(unregister_xenstore_notifier);
 
-/* called from a thread in privcmd/privcmd.c */
+/* 
+** Called either from below xenbus_probe_init() initcall (for domUs) 
+** or, for dom0, from a thread created in privcmd/privcmd.c (after 
+** the user-space tools have invoked initDomainStore()) 
+*/
 int do_xenbus_probe(void *unused)
 {
        int err = 0;
 
-       /* Initialize xenstore comms unless already done. */
+       /* Initialize the interface to xenstore. */
        err = xs_init();
        if (err) {
                printk("XENBUS: Error initializing xenstore comms:"
@@ -703,6 +707,10 @@ static int __init xenbus_probe_init(void)
        device_register(&xenbus_frontend.dev);
        device_register(&xenbus_backend.dev);
 
+       /* 
+       ** Domain0 doesn't have a store_evtchn yet - this will
+       ** be set up later by xend invoking initDomainStore() 
+       */
        if (!xen_start_info->store_evtchn)
                return 0;
 
index 8e52045853349b0413be7a5b084dc86272660891..ea0ead1596f9584e8cf89ee38c7af717543424d7 100644 (file)
@@ -780,6 +780,9 @@ static int read_thread(void *unused)
        }
 }
 
+/*
+** Initialize the interface to xenstore. 
+*/
 int xs_init(void)
 {
        int err;
@@ -793,6 +796,7 @@ int xs_init(void)
        init_MUTEX(&xs_state.transaction_mutex);
        xs_state.transaction_pid = -1;
 
+       /* Initialize the shared memory rings to talk to xenstored */
        err = xb_init_comms();
        if (err)
                return err;